Non-volatile memory (“NVM”), such as NAND flash memory, is commonly used for mass storage. For example, consumer electronics such as portable media players or cellular telephones often include flash memory to store data such as music, videos, and other media.
In conventional NVM systems, the translation layer reports the logical capacity of the NVM to the file system, where this logical capacity can correspond to a value smaller than the amount of data the NVM can physically hold. This reduction is done to reserve NVM data space to, for example, accommodate garbage collection, accommodate bad data blocks, and improve system performance by reducing the amount of garbage collection. In conventional direct-mapped disk storage systems, the logical capacity is equal to the media size minus any remapping reserves. When the free space in an NVM becomes low, however, the system may be unable to allocate data pieces into the NVM that are ideally-sized. Thus, the allocated data may need to be fragmented. File systems with a greater amount of fragmentation can perform poorly compared to less-fragmented file systems. This reduction in performance can be caused by, for example, increased seek time on rotational media; increased per-transaction overhead; any serialization or single-dispatch constraints; and increased overhead required for mapping more chunks of data than is ideal.